package sctu.edu.java.year2016.team02.zhoujie.day20160523.chapter5_2;

/**
 * Created by ACER on 2016/5/24.
 */
/*编写java程序，创建一维数组，并将其中最大的数输出*/
public class MaxNum {
    public static void main(String[] args) {
        int[] num = {7, 45, 78, 54, 88, 41};
        System.out.println("输出一堆数组：");
        for (int i = 0; i < num.length; i++) {
            System.out.println(num[i]);
        }
        int max = num[0];
        for (int i = 1; i < num.length - 1; i++) {
            if (max <= num[i])
                max = num[i];
        }
        System.out.println("数组中最大的数是：" + max);
    }
}
